.class public Lnet/oauth/client/ExcerptInputStream;
.super Ljava/io/BufferedInputStream;
.source "ExcerptInputStream.java"


# static fields
.field public static final ELLIPSIS:[B = null

.field private static final LIMIT:I = 0x400


# instance fields
.field private excerpt:[B


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 31
    const-string v0, " ..."

    invoke-static {v0}, Lnet/oauth/OAuth;->encodeCharacters(Ljava/lang/String;)[B

    move-result-object v0

    sput-object v0, Lnet/oauth/client/ExcerptInputStream;->ELLIPSIS:[B

    return-void
.end method

.method public constructor <init>(Ljava/io/InputStream;)V
    .locals 7
    .parameter "in"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    const/16 v5, 0x400

    const/4 v6, 0x0

    .line 34
    invoke-direct {p0, p1}, Ljava/io/BufferedInputStream;-><init>(Ljava/io/InputStream;)V

    .line 51
    sget-object v3, Lnet/oauth/client/ExcerptInputStream;->ELLIPSIS:[B

    array-length v3, v3

    add-int/lit16 v3, v3, 0x400

    new-array v3, v3, [B

    iput-object v3, p0, Lnet/oauth/client/ExcerptInputStream;->excerpt:[B

    .line 35
    invoke-virtual {p0, v5}, Lnet/oauth/client/ExcerptInputStream;->mark(I)V

    .line 36
    const/4 v2, 0x0

    .line 38
    .local v2, total:I
    :cond_0
    iget-object v3, p0, Lnet/oauth/client/ExcerptInputStream;->excerpt:[B

    rsub-int v4, v2, 0x400

    invoke-virtual {p0, v3, v2, v4}, Lnet/oauth/client/ExcerptInputStream;->read([BII)I

    move-result v0

    .local v0, read:I
    const/4 v3, -0x1

    if-eq v0, v3, :cond_1

    add-int/2addr v2, v0

    if-lt v2, v5, :cond_0

    .line 39
    :cond_1
    if-ne v2, v5, :cond_2

    .line 41
    sget-object v3, Lnet/oauth/client/ExcerptInputStream;->ELLIPSIS:[B

    iget-object v4, p0, Lnet/oauth/client/ExcerptInputStream;->excerpt:[B

    sget-object v5, Lnet/oauth/client/ExcerptInputStream;->ELLIPSIS:[B

    array-length v5, v5

    invoke-static {v3, v6, v4, v2, v5}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 47
    :goto_0
    invoke-virtual {p0}, Lnet/oauth/client/ExcerptInputStream;->reset()V

    .line 48
    return-void

    .line 43
    :cond_2
    new-array v1, v2, [B

    .line 44
    .local v1, tmp:[B
    iget-object v3, p0, Lnet/oauth/client/ExcerptInputStream;->excerpt:[B

    invoke-static {v3, v6, v1, v6, v2}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 45
    iput-object v1, p0, Lnet/oauth/client/ExcerptInputStream;->excerpt:[B

    goto :goto_0
.end method


# virtual methods
.method public getExcerpt()[B
    .locals 1

    .prologue
    .line 56
    iget-object v0, p0, Lnet/oauth/client/ExcerptInputStream;->excerpt:[B

    return-object v0
.end method
